package observer_pattern.v2;

/**
 * 前台秘书类
 * @author ricejson
 */
public class Secretary extends Subject {

    public Secretary(String name) {
        super(name);
    }

    @Override
    public void attach(Observer observer) {
        observerList.add(observer);
    }

    @Override
    public void detach(Observer observer) {
        observerList.remove(observer);
    }

    @Override
    public void broadcast() {
        for (Observer observer : observerList) {
            observer.update();
        }
    }
}
